package org.ting.book.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.ting.book.model.UserInfo;

@Mapper
public interface UserMapper {
    @Select("select * from user_info where user_name = #{userName}")
    UserInfo getUserInfoByName(String userName);
    @Select("select * from user_info where id = #{id}")
    UserInfo getUserInfoById(Integer id);
    @Insert("insert into user_info(user_name, password) values (#{userName}, #{password})")
    Integer insert(String userName, String password);

    Integer update(UserInfo userInfo);
}
